<%--
  Created by IntelliJ IDEA.
  User: LQ
  Date: 2023/8/9
  Time: 18:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <title>系统首页</title>
    <!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->

    <link rel="shortcut icon" href="favicon.ico">
    <link href="style/hplus/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="style/hplus/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="style/hplus/css/animate.min.css" rel="stylesheet">
    <link href="style/hplus/css/style.min.css?v=4.0.0" rel="stylesheet">
    <style type="text/css">
        .new-contact__header {

            text-align: center;
            /* padding: 30px 0; */
            /* border-radius: 2px 2px 0 0; */
        }

        .zmdi {
            display: inline-block;
            font: normal normal normal 14px/1 'Material-Design-Iconic-Font';
            font-size: inherit;
            text-rendering: auto;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        .new-contact__upload {
            position: absolute;
            top: 20px;
            left: 20px;
            font-size: 1.5rem;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            line-height: 40px;
            background-color: blueviolet;
            color: beige;
            cursor: pointer;
            transition: background-color .3s;
        }
    </style>

</head>

<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<div id="wrapper">
    <!--左侧导航开始-->
    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="nav-close"><i class="fa fa-times-circle"></i>
        </div>
        <div class="sidebar-collapse">
            <ul class="nav">
                <li class="nav-header">
                    <div class="dropdown profile-element">
                        <span><img id="img-user" alt="image" class="img-circle" style="width: 64px"
                                   src="./style/img/head.jpeg"/></span>
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                <span class="clear">
                               <span class="block m-t-xs"><span class="font-bold"
                                                                id="span-uName">Beaut-zihan</span></span>
                                <span class="text-muted text-xs block"><span id="span-job"></span><b class="caret"></b></span>
                                </span>
                        </a>
                        <ul class="dropdown-menu animated fadeInRight m-t-xs">
                            <li>
                                <a onclick="com.getUsers()" data-toggle="modal" data-target="#modal-form">个人资料</a>
                            </li>
                            <li class="divider"></li>
                            <li><a onclick="com.outLogin()" href="#">安全退出</a>
                            </li>
                        </ul>
                    </div>
                    <div class="logo-element">H+
                    </div>
                </li>
            </ul>
            <div id="div-menus" style="overflow-y: auto;">
                <ul class="nav" id="side-menu">

                </ul>
            </div>
        </div>
    </nav>
    <!--左侧导航结束-->
    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row border-bottom">
            <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                <div class="navbar-header">
                    <%--                    <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i--%>
                    <%--                        class="fa fa-bars"></i> </a>--%>
<%--                    <form role="search" class="navbar-form-custom" method="post" action="search_results.html">--%>
<%--                        <div class="form-group">--%>
<%--                            <input type="text" placeholder="请输入您需要查找的内容 …" class="form-control" name="top-search"--%>
<%--                                   id="top-search">--%>
<%--                        </div>--%>
<%--                    </form>--%>
                </div>
                <ul class="nav navbar-top-links navbar-right">
                    <li class="dropdown">
<%--                        <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">--%>
<%--                            <i class="fa fa-envelope"></i> &lt;%&ndash; <span class="label label-warning">16</span> &ndash;%&gt;--%>
<%--                        </a>--%>
                        <ul class="dropdown-menu dropdown-messages">
                            <li class="m-t-xs">
                                <div class="dropdown-messages-box">
                                    <a href="#" class="pull-left">
<%--                                        <img alt="image" class="img-circle" src="./style/img/head.jpeg">--%>
                                    </a>
                                    <div class="media-body">
<%--                                        <small class="pull-right">46小时前</small>--%>
<%--                                        <strong>小四</strong> 这个在日本投降书上签字的军官，建国后一定是个不小的干部吧？--%>
<%--                                        <br>--%>
<%--                                        <small class="text-muted">3天前 2014.11.8</small>--%>
                                    </div>
                                </div>
                            </li>
                            <li class="divider"></li>
                            <li>
                                <div class="dropdown-messages-box">
                                    <a href="#" class="pull-left">
<%--                                        <img alt="image" class="img-circle" src="./style/img/head.jpeg">--%>
                                    </a>
<%--                                    <div class="media-body ">--%>
<%--                                        <small class="pull-right text-navy">25小时前</small>--%>
<%--                                        <strong>国民岳父</strong> 如何看待“男子不满自己爱犬被称为狗，刺伤路人”？——这人比犬还凶--%>
<%--                                        <br>--%>
<%--                                        <small class="text-muted">昨天</small>--%>
<%--                                    </div>--%>
                                </div>
                            </li>
                            <li class="divider"></li>
                            <li>
                                <div class="text-center link-block">
<%--                                    <a class="J_menuItem" href="mailbox.html">--%>
<%--                                        <i class="fa fa-envelope"></i> <strong> 查看所有消息</strong>--%>
<%--                                    </a>--%>
                                </div>
                            </li>
                        </ul>
                    </li>
                    <li class="dropdown">
<%--                        <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">--%>
<%--                            <i class="fa fa-bell"></i>&lt;%&ndash;  <span class="label label-primary">8</span>&ndash;%&gt;--%>
<%--                        </a>--%>
                        <ul class="dropdown-menu dropdown-alerts">
                            <li>
<%--                                <a href="mailbox.html">--%>
                                    <div>
<%--                                        <i class="fa fa-envelope fa-fw"></i> 您有16条未读消息--%>
<%--                                        <span class="pull-right text-muted small">4分钟前</span>--%>
                                    </div>
                                </a>
                            </li>
                            <li class="divider"></li>
                            <li>
<%--                                <a href="profile.html">--%>
                                    <div>
<%--                                        <i class="fa fa-qq fa-fw"></i> 3条新回复--%>
<%--                                        <span class="pull-right text-muted small">12分钟钱</span>--%>
                                    </div>
                                </a>
                            </li>
                            <li class="divider"></li>
                            <li>
                                <div class="text-center link-block">
<%--                                    <a class="J_menuItem" href="notifications.html">--%>
<%--                                        <strong>查看所有 </strong>--%>
<%--                                        <i class="fa fa-angle-right"></i>--%>
<%--                                    </a>--%>
                                </div>
                            </li>
                        </ul>
                    </li>
                </ul>
            </nav>
        </div>
        <div class="row content-tabs">
            <button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i>
            </button>
            <nav class="page-tabs J_menuTabs">
                <div class="page-tabs-content">
                    <a href="javascript:;" class="active J_menuTab" data-id="Right.jsp">首页</a>
                </div>
            </nav>
            <button class="roll-nav roll-right J_tabRight"><i class="fa fa-forward"></i>
            </button>
            <div class="btn-group roll-nav roll-right">
                <button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span>

                </button>
                <ul role="menu" class="dropdown-menu dropdown-menu-right">
                    <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
                    </li>
                    <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
                    </li>
                </ul>
            </div>
            <a onclick="com.outLogin()" href="#" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i>
                退出</a>
        </div>
        <div class="row J_mainContent" id="content-main">
            <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="setTaskSend/sendTask.jsp" data-id="Right.jsp" frameborder="0" seamless></iframe>
        </div>
        <div class="footer">
            <div class="pull-right">&copy; 2001-2023 <a href="#">沈阳金万码高科技发展有限公司</a>
            </div>
        </div>
    </div>
    <!--右侧部分结束-->
    <!--mini聊天窗口开始-->
    <div class="small-chat-box fadeInRight animated" style="width: 350px">
        <div class="heading" draggable="true">
            <small class="chat-date pull-right" id="s-date">
                2015.9.1
            </small> 公告信息
        </div>

        <div class="content">

            <div class="left">
                <div class="author-name" id="div-content">
                    暂无最新公告！
                </div>
            </div>
        </div>
        <div class="form-chat">
            <div class="input-group input-group-sm">
                <input type="hidden" id="Hidnid" value="">
                <a href="sysSet/noticeList.jsp" onclick="opt.readNotices(0)"
                   class=" J_menuItem btn btn-primary" type="button">查看
                </a>
                <span class="input-group-btn">
                    <button class="btn btn-warning" onclick="opt.readNotices(1)" type="button"
                            id="bt-remind">近期不在显示</button>
                </span>
            </div>
        </div>
    </div>
    <div id="small-chat">
        <span class="badge badge-warning pull-right"></span>
        <a class="open-small-chat">
            <i class="fa fa-comments"></i>
        </a>
    </div>

    <%--    用户信息--%>
    <div class="modal fade inmodal" id="modal-form" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content animated bounceInRight">
                <div class="modal-body">
                    <div class="new-contact__header" id="up_btn">
                        <a href="" class="zmdi zmdi-camera new-contact__upload"><i class="fa fa-camera"></i></a>
                        <input class="zmdi zmdi-camera new-contact__upload" id="photoimg"
                               style="opacity:0;cursor: pointer" type="file" name="photoimg"/>
                        <img src="style/img/head.jpeg" style="border-radius: 50%" alt="" height="150px"
                             width="150px"
                             id="Img_user">
                    </div>
                    <div class="row">
                        <h3>用户信息</h3>
                        <form class="form-horizontal m-t" id="myForm">
                            <input type="hidden" id="userid" name="userid" value="">
                            <input type="hidden" id="deptcode" name="deptcode" value="">
                            <input type="hidden" id="jobcode" name="jobcode" value="">
                            <input type="hidden" id="isSale" name="isSale" value="">
                            <input type="hidden" id="imgurl" name="imgurl" value="">

                            <div class="form-group">
                                <label class="col-sm-3 control-label" l="spot">姓名：</label>
                                <div class="col-sm-8">
                                    <input id="name" name="name" required class="form-control" type="text">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label" l="spot">所属部门：</label>
                                <div class="col-sm-8">
                                    <input id="txtDeptName" name="txtDeptName" disabled class="form-control" type="text">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label" l="spot">所属职务：</label>
                                <div class="col-sm-8">
                                    <input id="txtJobName" name="txtJobName" disabled class="form-control" type="text">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">是否销售：</label>
                                <div class="col-sm-8">
                                    <div class="radio radio-info radio-inline">
                                        <input type="radio" id="r-fun" value="0" checked name="sales">
                                        <label for="r-fun"> 否 </label>
                                    </div>
                                    <div class="radio radio-info radio-inline">
                                        <input type="radio" id="r-com" value="1" name="sales">
                                        <label for="r-com"> 是 </label>
                                    </div>
                                </div>
                            </div>
                            <div name="f-sales" class="form-group">
                                <label class="col-sm-3 control-label" l="spot">*T6用户编码：</label>
                                <div class="col-sm-8">
                                    <input id="t6usercode" name="t6usercode" class="form-control" type="text">
                                </div>
                            </div>
                            <div name="f-sales" class="form-group">
                                <label class="col-sm-3 control-label" l="spot">T6单位编码：</label>
                                <div class="col-sm-8">
                                    <input id="tDeptcode" name="tDeptcode" class="form-control" type="text">
                                </div>
                            </div>
                            <div name="f-sales" class="form-group">
                                <label class="col-sm-3 control-label" l="spot">客户类型：</label>
                                <div class="col-sm-8">
                                    <select class="form-control" id="customerType" name="customerType">
                                        <option value="国内">国内</option>
                                        <option value="国外">国外</option>
                                    </select>
                                </div>
                            </div>
                            <div name="f-sales" class="form-group">
                                <label class="col-sm-3 control-label" l="spot">客户编码：</label>
                                <div class="col-sm-8">
                                    <input id="customerCode" name="customerCode" class="form-control" type="text">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">联系电话：</label>
                                <div class="col-sm-8">
                                    <input id="tel" name="tel" class="form-control" type="text">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">手机号码：</label>
                                <div class="col-sm-8">
                                    <input id="mobile" name="mobile" class="form-control" type="text">
                                </div>
                            </div>
                            <h4>账号设置</h4>
                            <div class="form-group">
                                <label class="col-sm-3 control-label" l="spot">登录用户名：</label>
                                <div class="col-sm-8">
                                    <input id="username" name="username" required class="form-control" type="text">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label" l="spot">登录密码：</label>
                                <div class="col-sm-8">
                                    <input id="userpassword" name="userpassword" required class="form-control"
                                           type="text">
                                </div>
                            </div>

                            <h4 style="color: #9E792E" id="h-defined">自定义表单</h4>
                        </form>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" name="bt-close" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" onclick="opt.saveUsersInfo(this)">保存</button>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="style/hplus/js/jquery.min.js?v=2.1.4"></script>
<script src="style/hplus/js/bootstrap.min.js?v=3.3.5"></script>
<script src="style/hplus/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="style/hplus/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="style/hplus/js/plugins/layer/layer.min.js"></script>
<script src="style/hplus/js/hplus.min.js?v=1"></script>
<script src="style/hplus/js/plugins/pace/pace.min.js"></script>
<script src="script/jquery.cookie.js"></script>
<%
    double ranNum = Math.random() * 1000;
%>
<%--数据查询JS--%>
<script src="script/queryJs.js?v=<%=ranNum%>"></script>
<%--    公共Js--%>
<script src="../script/commonJs.js?v=<%=ranNum%>"></script>

<%--    表单验证--%>
<script src="style/hplus/js/plugins/validate/jquery.validate.min.js"></script>
<script src="style/hplus/js/plugins/validate/messages_zh.min.js"></script>
<%--    数据操作--%>
<script src="script/operateJs.js?v=<%=ranNum%>"></script>
<%--    表单项配置--%>
<script src="script/formConfigJs.js"></script>
<!-- Sweet 弹窗 -->
<link href="style/hplus/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
<script src="style/hplus/js/plugins/sweetalert/sweetalert.min.js"></script>
<%--单选按钮样式--%>
<link href="style/hplus/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
<%--文件上传--%>
<script language="JavaScript" src="script/ajaxfileupload.js"></script>
<script type="text/javascript">
    $(function () {
        //  获取自定义表单数据
        com.queryFormCustoms('users');
        //  设置必填提示
        $("#myForm label[l='spot']").prepend("<span style='color: red'>*</span>");
        var users = JSON.parse($.cookie("users"));
        //  表单渲染
        // fComfig.loadFormItem("users");
        $("#div-menus").css("height", $(window).height() - 130 + "px");
        $("#span-uName").html(users.name);
        $("#img-user,#Img_user").attr("src", users.imgurl);
        $("#span-job").html(users.jobname);
        $("#txtDeptName").val(users.deptname);
        $("#txtJobName").val(users.jobname);
        query.queryUserMenus();

        $("input[type='radio']").on('click', function () {
            var isSale = $(this).val();
            if (isSale == 0) {
                $("div[name='f-sales']").hide();
                $("#t6usercode").rules("remove", 'required');
                $("#tDeptcode").rules("remove", 'required');
                $("#customerCode").rules("remove", 'required');
            } else {
                $("div[name='f-sales']").show();
                $("#t6usercode").rules("add", 'required');
                $("#tDeptcode").rules("add", 'required');
                $("#customerCode").rules("add", 'required');
            }
        });
        //  修改头像
        $("#up_btn").on("change", "#photoimg", function () {
            $.ajaxFileUpload({
                url: '../users/saveUserImg',
                secureuri: false,
                fileElementId: "photoimg", //文件选择框的id属性
                type: 'post',
                dataType: 'text',
                success: function (data) {
                    var reault = data.split('|');
                    if (reault[1] != "fail") {
                        $("#imgurl").val(reault[2]);
                        $("#Img_user").attr("src", reault[2]);
                    }
                }
            });
        });
        //  获取公告信息
        com.queryNotices();
    });
</script>
<script type="text/javascript" src="style/hplus/js/contabs.min.js?v=<%=ranNum%>"></script>

<%--消息监听--%>
<script>
    var socket;
    if (typeof (WebSocket) == "undefined") {
        console.log("您的浏览器不支持WebSocket");
    } else {
        console.log("您的浏览器支持WebSocket");

        // //实现化WebSocket对象，指定要连接的服务器地址与端口  建立连接
        // socket = new WebSocket("ws://localhost:8089/websocket/78");
        //
        // //打开事件
        // socket.onopen = function() {
        //     console.log("Socket 已打开");
        // };
        //
        // //获得消息事件
        // socket.onmessage = function(msg) {
        //     console.log(msg.data);
        //     // document.getElementById('text').innerHTML = msg.data;
        // };
        //
        // //关闭事件
        // socket.onclose = function() {
        //     console.log("Socket已关闭");
        // };
        //
        // //发生了错误事件
        // socket.onerror = function() {
        //     alert("Socket发生了错误");
        // }
        //
        // //关闭连接
        // function closeWebSocket() {
        //     socket.close();
        // }
    }
</script>
</body>

</html>